package com.ilong.passbook.merchants.security;

/**
 *用ThreadLocal 去单独存储每一个线程携带的Token信息
 *
 * @author long
 * @date 2020-01-05 23:23
 */
public class AccessContext {

    private static final ThreadLocal<String> token=new ThreadLocal<String>();

    public static String getToken(){
        return token.get();
    }

    public static void setToken(String tokenStr){
        token.set(tokenStr);
    }

    public static void clearAccessKey(){
        token.remove();
    }

}
